import request from '@/utils/request'
/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getPermissionListApi = (params) => {
  return request({
    url: '/sys/permission',
    method: 'get',
    params
  })
}

/**
 * 查询单个
 * @param {*} id
 * @returns
 */
export const getPermissionInfoApi = (id) => {
  return request({
    url: '/sys/permission/' + id,
    method: 'get'
  })
}
/**
 * 添加
 * @param {*} data
 * @returns
 */
export const addPermissionApi = (data) => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}
/**
 * 修改
 * @param {*} data
 * @returns
 */
export const editPermissionApi = (data) => {
  return request({
    url: '/sys/permission/' + data.id,
    method: 'put',
    data
  })
}
/**
 * 删除
 * @param {*} id
 * @returns
 */
export const delPermissionApi = (id) => {
  return request({
    url: '/sys/permission/' + id,
    method: 'delete'
  })
}
